//
//  MatchTableViewController.m
//  ICup
//
//  Created by liao Echo on 14-10-12.
//  Copyright (c) 2014年 Echo. All rights reserved.
//

#import "MatchTableViewController.h"

@interface MatchTableViewController ()

@end

@implementation MatchTableViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0 || indexPath.row == 2) {
        return 44;
    }else{
        return 80;
    }
}
-(CGFloat)tableView:(UITableView *)aTableView heightForHeaderInSection:(NSInteger)section {
    return 20;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return  3;
}

- (UITableViewCell *)tableView:(UITableView *)tableview cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *CellIdentifier = @"SettingBaseCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.backgroundColor = [UIColor clearColor];//ios7必须要这样处理，不然默认会是白色
    
    if (indexPath.row == 0) {
        cell.textLabel.text = @"配对信息如下";
        
    }else if(indexPath.row == 1){
        cell.textLabel.font = [UIFont systemFontOfSize:16];
        cell.textLabel.numberOfLines = 0;
        cell.textLabel.textColor = [UIColor grayColor];
        cell.textLabel.text = @"a\n序列号:CT4801006516";
    }else {
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.textLabel.text = @"增加配对";
    }
    return cell;
}
#pragma mark - Table view delegate

- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [atableView deselectRowAtIndexPath:indexPath animated:YES];
    
    if (indexPath.row ==2) {
        
    }
}
@end
